package moltencore.player;

import moltencore.game.AbstractPlayer;

public class Player extends AbstractPlayer {
	private final long session;

	public Player(String name, long session, long clientId) {
		super(name, clientId);
		this.session = session;
	}

	public long getSession() {
		return session;
	}

	@Override
	public boolean equals(Object o) {
		if(this == o) return true;
		if(o == null || getClass() != o.getClass()) return false;
		if(!super.equals(o)) return false;

		Player player = (Player) o;

		if(session != player.session) return false;

		return true;
	}

	@Override
	public int hashCode() {
		int result = super.hashCode();
		result = 31 * result + (int) (session ^ (session >>> 32));
		return result;
	}
}
